import time
import uiautomator2 as u2

# 基础模板
d = u2.connect("127.0.0.1")
print(d.info)
# 默认解锁
if not d.info["screenOn"]:
    d.screen_on()
    d.swipe_ext("up")

time.sleep(1)
d.press("home")
time.sleep(1)
d.press("home")
time.sleep(1)